<style lang="less" scoped>
  @import "../../assets/css/variable.less"; // less变量
  .global_popup_ui {
    width: 0;
    height: 0;
    position: fixed;
    left: 0;
    bottom: 0;
    z-index: 100;
    .header {
      width: 100%;
      height: 70px;
      padding: 30px 30px 0;
      display: flex;
      justify-content: space-between;
      align-items: center;
      &.type1 {
        background: #F9F9F9;
      }
      .left {
        display: flex;
        justify-content: flex-start;
        align-items: center;
        img {
          width: 40px;
          height: 40px;
          font-size: 0;
        }
        span {
          font-size: 26px;
          color: #333333;
          letter-spacing: 1px;
          margin-left: 10px;
        }
      }
      .right {
        width: 32px;
        height: 32px;
        font-size: 0;
      }
    }
    .content0 {
      padding: 60px;
      input {
        width: 100%;
        height: 60px;
        border-bottom: 0.5px solid #EEEEEE;
        font-size: 30px;
      }
      .code {
        margin-top: 60px;
        position: relative;
        span {
          color: #307CFF;
          font-size: 26px;
          position: absolute;
          top: 50%;
          right: 0;
          transform: translateY(-50%);
          &.count_down {
            color: #CECECE;
          }
        }
      }
      .btn {
        width: 100%;
        height: 96px;
        line-height: 96px;
        text-align: center;
        margin-top: 60px;
        border-radius: 48px;
        background: #AAAFB9;
        font-size: 36px;
        color: #fff;
        border: none;
        transition: .3s background;
        &.btn_disabled {
          background: #307CFF;
        }
      }
    }
    .content1 {
      padding: 10px;
      &.type1 {
        background: #F9F9F9;
      }
      > p {
        margin-top: 10px;
        padding: 20px;
        font-size: 30px;
        color: #333;
        background: #fff;
        line-height: 42px;
      }
    }
  }
</style>

<template>
  <div class="global_popup_ui">
    <van-popup
      v-model="show"
      v-if="type === 0"
      @close="close"
      position="bottom"
      safe-area-inset-bottom
      round
      :close-on-click-overlay="false"  
      :style="{width:$store.state.isMobile ? '100%' : '400px',left:$store.state.isMobile ? 0 : 'calc(50% - 200px)' }"
    >
      <header class="header">
        <div class="left">
          <img src="../../assets/images/zxjtqh/zxjt_logo.png" alt="">
          <span>{{title}}</span>
        </div>
        <img class="right" src="../../assets/images/zxyh-close.png" alt="" @click="close">
      </header>
      <div class="content0">
        <input type="number" :value="phone" placeholder="请输入手机号码" @input="e => $emit('onPhoneChange', e)">
        <div class="code">
          <input type="number" :value="code" placeholder="请输入短信验证码" @input="e => $emit('onCodeChange', e)">
          <span @click="onGetCode" :class="codeState === 0 ? '' : 'count_down'">获取验证码{{codeState === 0 ? '' : `（${num}s）`}}</span>
        </div>
        <button class="btn" :class="{'btn_disabled': !isDisabled}" @click="onSubmit" :disabled="isDisabled">确认</button>
      </div>
    </van-popup>
  </div>
</template>

<script>
    // 0 手机验证弹出框 1 明信片  2 课节列表
  import LectuerCard from '../../components/zxjtqh/LectuerCard.vue';
  import CourseList from '../../components/zxjtqh/CourseList.vue';
  export default {
    name: "GlobalPopupUI",
    props: ['type', 'show', 'close', 'phone', 'code', 'isDisabled', 'codeState', 'num', 'title', 'lectuerInfo', 'courseInfo', 'onGetCode', 'onSubmit'],
    components: {
      LectuerCard,
      CourseList,
    },
    data(){
      return{
      }
    },
    created() {
      
    },
    methods: {
    },
  };
</script>
